<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('角色数据权限')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-role-edit">
			<div class="row" style="display: none;">
				<input id="orderId" th:value="*{orderId}">
			</div>
			<div class="form-group">
				<div class="col-sm-6">
					<select id="orderStatus" class="form-control"  th:with="type=${@dict.getType('business_order_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">
		var prefix = ctx + "order";
		function submitHandler() {
	        if ($.validate.form()) {
	        	edit();
	        }
	    }
		
		function edit() {
			var orderId = $("#orderId").val();
			var orderStatus = $("#orderStatus option:selected").val();
			$.ajax({
				type : "PUT",
				url : prefix + "/status/"+orderId,
				data : {
					"orderStatus": orderStatus
				},
				async : true,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}

	</script>
</body>
</html>
